from flask import request,render_template
import json
from . import main_login


@main_login.route('/')
def index():
    return render_template("login.html")


@main_login.route('/login')
def login():
    data = {
        'state': 'success',
        'msg': '登录成功'
    }

    fail_data = {
        'state': 'fail',
        'msg':  '用户名或密码不正确'
    }
    return json.dumps(data)


@main_login.route('/loginSuccess')
def login_success():
    return render_template("pages/index.html")
